Blockly.Blocks['start'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("当运行时");
    this.setPreviousStatement(false, null);
    this.setNextStatement(true, null);
    this.setColour(90);
 this.setTooltip("");
 this.setHelpUrl("");
 this.setMovable(false);
  }
};
Blockly.Blocks['moveforward_up'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("向上走");
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setColour(330);
 this.setTooltip("");
 this.setHelpUrl("");
  }
};

Blockly.Blocks['moveforward_down'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("向下走");
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setColour(330);
 this.setTooltip("");
 this.setHelpUrl("");
  }
};

Blockly.Blocks['moveforward_left'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("向左走");
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setColour(330);
 this.setTooltip("");
 this.setHelpUrl("");
  }
};

Blockly.Blocks['moveforward_right'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("向右走");
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setColour(330);
 this.setTooltip("");
 this.setHelpUrl("");
  }
};


Blockly.Blocks['turn'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("向")
        .appendField(new Blockly.FieldDropdown([["左","Left"], ["右","Right"]]), "direction")
        .appendField("转");
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setColour(180);
 this.setTooltip("");
 this.setHelpUrl("");
  }
};